package com.neusoft.repository.helper;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: repository
 * @description:
 * @author: dong.tl
 * @create: 2019-02-19 10:16
 **/
public class ServiceResultHelper {
    public static Map genResultWithSuccess() {
        Map req = new HashMap();
        req.put("code", "success");
        return req;
    }

    public static Map genResultWithSuccess(String msg) {
        Map req = genResultWithSuccess();
        req.put("msg", msg);
        return req;
    }

    public static Map genResultWithSuccess(Map map) {
        Map req = genResultWithSuccess();
        req.putAll(map);
        return req;
    }

    public static Map genResultWithFaild(String ERROR_MSG) {
        Map req = new HashMap();
        req.put("code", "faild");
        req.put("error_msg", ERROR_MSG);
        return req;
    }
}
